#ifndef FRAMEDMATRIX_H
#define FRAMEDMATRIX_H
/*
#include <vector>
#include <memory.h>

#include "FEM/CONTAINERS/abstractmatrix.h"

/// \brief The Matrix class \n
/// Default each frame has 1M * sizeof(_DimType_) data cells
template <
        typename _DimType_,
        int _maxNumColsPerFrame_ =  0x1000>
class FramedMatrix : public AbstractMatrix <_DimType_>
{
private:
    struct _Frame
    {
       int nCols;
       _DimType_ *data;
    };
    _Frame **_rows;
    int _nFramesCol;
    struct _Row
    {
        _Frame *_frames;
        _DimType_& operator [] (const int indexOfCol) const
        {
            return _frames[indexOfCol/_maxNumColsPerFrame_].data[
                   indexOfCol-(indexOfCol/_maxNumColsPerFrame_*_maxNumColsPerFrame_)];
        }
    };
public:
    _Row operator [] (const int indexOfRow) const
    {
        _Row r = {this->_rows[indexOfRow]};
        return r;
    }
    FramedMatrix(const int nRows,const int nCols):
        AbstractMatrix<_DimType_>(nRows,nCols)
    {               
        _nFramesCol = this->nCols/_maxNumColsPerFrame_;
        int _lastNumCols = this->nCols%_maxNumColsPerFrame_;
        if(_lastNumCols>0)++_nFramesCol;

        _rows = new _Frame*[this->nRows];
        for(int i=0;i<this->nRows;++i)
            _rows[i] = new _Frame[_nFramesCol];
        for(int i=0;i<this->nRows;++i)
            for(int j=0;j<_nFramesCol;++j)
            {
                if(j == _nFramesCol-1 && _lastNumCols>0)
                {
                    _rows[i][j].nCols = _lastNumCols;
                    _rows[i][j].data = new _DimType_[_lastNumCols];
                    memset(_rows[i][j].data, 0, _lastNumCols*sizeof(_DimType_));
                }
                else
                {
                    _rows[i][j].nCols = _maxNumColsPerFrame_;
                    _rows[i][j].data = new _DimType_[_maxNumColsPerFrame_];
                    memset(_rows[i][j].data, 0, _maxNumColsPerFrame_*sizeof(_DimType_));
                }
            }
    }
    FramedMatrix(const FramedMatrix &m) = delete;
    FramedMatrix operator = (const FramedMatrix &m) = delete;
    _DimType_& operator () (const int indexOfRow, const int indexOfCol) const override
    {
        return this->_rows[indexOfRow][indexOfCol/_maxNumColsPerFrame_].data[
               indexOfCol-(indexOfCol/_maxNumColsPerFrame_*_maxNumColsPerFrame_)];
    }
    AbstractMatrix<_DimType_>& operator + (const AbstractMatrix<_DimType_> &m) override
    {
        /// \todo
        FramedMatrix _rez(this->nRows, this->nCols);
        for(int i=0;i<this->nRows;++i)
            for(int j=0;j<this->nCols;++j)
                _rez(i,j) = (*this)(i,j) + m(i,j);
        return _rez;
    }

private:
    void _simpleTranspose()
    {
        for(int i=0;i<this->nRows;++i)
            for(int j=1+i;j<this->nCols;++j)
            {
                _DimType_ _tmpVal = (*this)(i,j);
                (*this)(i,j) = (*this)(j,i);
                (*this)(j,i) = _tmpVal;
            }
    }
public:
    void transpose() override
    {
        _simpleTranspose();
        /// \todo
    }
private:
    static void _simpleProduct(
            FramedMatrix &rez,
            const FramedMatrix &m1,
            const FramedMatrix &m2)
    {
        for(int i=0;i<m1.nRows;++i)
            for(int j=0;j<m2.nCols;++j)
            {
                _DimType_ _sum = 0;
                for(int k=0;k<m1.nCols;++k)
                    _sum += m1(i,k) * m2(k,j);
                rez(i,j) = _sum;
            }
    }
public:
    static void product (
                FramedMatrix &rezult,
                const FramedMatrix &m1,
                const FramedMatrix &m2)
    {
        _simpleProduct(rezult,m1,m2);
        /// \todo
    }
    ~FramedMatrix() override
    {
        for(int i=0;i<this->nRows;++i)
        {
            for(int j=0;j<_nFramesCol;++j)
                delete [] _rows[i][j].data;
            delete [] _rows[i];
        }
        delete [] _rows;
    }
};
*/
#endif // FRAMEDMATRIX_H
